<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/static/commons/taglibs.jsp"%>
<%@ include file="/static/commons/meta.jsp"%>
<%@ include file="/static/commons/jquery-easyui.jsp"%>
<html >
	 <head>
 		<title>${title }</title>
		 <!-- 开票申请 -->
 		 <link rel="stylesheet" href="${ctx }/static/styles/basic/basic.css" />
		 <link rel="stylesheet" href="${ctx }/static/styles/frame/main.css" />
		 <link rel="stylesheet" href="${ctx }/static/styles/frame/searchBtn.css" />
		 <link rel="stylesheet" href="${ctx }/static/styles/frame/searchCondition.css" />
	    <!-- js -->
 		<script type="text/javascript" src="${ctx}/static/scripts/check_all.js"></script>
 		<script type="text/javascript" src="${ctx}/static/scripts/set_select.js"></script>
 		<script type="text/javascript" src="${ctx}/static/scripts/waiting.js"></script>
 		<script type="text/javascript" src="${ctx}/static/scripts/crud.js"></script>
 		<script type="text/javascript" src="${ctx}/static/scripts/util.js"></script>
 		<script type="text/javascript" src="${ctx}/static/scripts/WdatePicker/WdatePicker.js"></script>
		
	</head>
  	<body onload="init()">
		<form action="${ctx}/billing/list" method="post">
  			<input type="hidden" name="RequestVerificationToken" value="${RequestVerificationToken}" />
			<div class="width_100 group_box">
				<div class="group_search width_100">
					<vvise:select id="custId" name="p_custId" sqlname="getCust" ifSearch="true" displayText="用户单位" />
					<vvise:select id="status" name="p_status" sqlname="getCodeData" sqlparam="billing_status" displayText="状态" ifSearch="true"/>
					<vvise:searchInput id="startDate" name="p_startDate" defVal="${startDate}" 
			                endId="endDate" endName="p_endDate" endDefVal="${endDate}"
			                 type="time2" displayText="时间" dateFormat="yyyy-MM-dd"/>
               	 	<div class="clear_both"></div>
				</div>
				<vvise:funMenu menuId="${menuId}" />
			</div>
        </form>
        <div class="listFrame">
        	<iframe name="listFrame" id="listFrame" frameBorder="0"
				scrolling="auto" style="width: 100%;height:100%;"></iframe>
        </div>
	</body>
	<script type="text/javascript">
  		var headers = {};
		headers['__RequestVerificationToken'] = "${RequestVerificationToken}";
			//回车事件
		document.onkeydown = keyKistener;
		function keyKistener(e){
			e = e ? e:event;
			if(e.keyCode == 13){
				try{
					search();
				}catch(e){}
			}
		}
		function init(){
			set_iframe_h();
			$(window).resize(function(){
				set_iframe_h();
			});
			search();
			$('.easyui-combobox').combobox();
		}
		//设置ifream 高度
		function set_iframe_h(){
			var win_height  = $(window).height();
			var func_line_h = $('.group_box').outerHeight(true);
			var list_height = win_height - func_line_h;
			$('.listFrame').css('height',list_height-10);
		}
		function search(){
			waiting();
			document.forms[0].target = "listFrame";
			document.forms[0].submit();
		}
	
		function save(){
			var pp = parent;
			var editFrame = pp.winFrame;
			var id = editFrame.$('#orderId').val();
			
			var isRequired = editFrame.Index.required();
			if(!isRequired){
				return;
			}
			doSave("${ctx}/billing/save", id);
		}
		
		function view(id,status){
			var pp = parent;
			doView("开票信息",pp.width3, 500, "${ctx}/billing/edit?orderId="+id+"&view=view"+"&&status="+status);
		}
		
		function billing(id,status){
			var pp = parent;
			doCreate("开票申请",pp.width3, 500, "${ctx}/billing/edit?orderId="+id+"&status="+status);
		}
		
		</script>
</html>